clear all
set	more off

*cd "~/Library/CloudStorage/Dropbox/ors_quality_R01"
cd "~/Dropbox/ors_quality_R01"
use "data/KDG/know_do_gap.dta", clear


sum know_anti if sp_type!=1 
gen plot = r(mean) if _n ==1

sum rec_anti if sp_type!=1 & know_anti==1
replace plot = 1-r(mean) if _n ==2


	replace plot = plot*100

	gen full = 100 if _n==1|_n==2
	
gen axis = _n if _n<=2

twoway(bar full axis if _n==1, color(blue*.1) barwidth(.5)) ///
(bar full axis if _n==2, color(red*.1) barwidth(.5)) ///
(bar plot axis if _n==1, color(blue*.4) barwidth(.5)) ///
(bar plot axis if _n==2, color(red*.4) barwidth(.5)) , ///
xlabel(.5 " " 1 "Know gap" 2 "Know-do gap" 2.5 " ", labsize(small)) ///
ylabel(0(10)100, grid gstyle(dot)) ///
legend(order(3 "Correct knowledge" 4 "No Abx Prescription (if correct knowledge)" 1 "Know gap" 2 "Know-do gap") size(small)) ///
xtitle(" ") ///
ytitle("%")

graph export "figures/know_do_figure_anti.pdf", replace
 
